package la.iok.hzsvn.lewin.movie.model;

import la.iok.hzsvn.share.annotations.NotNull;

import java.util.Objects;

public class AppPackageItemParam {
    /**
     * 程序包的id
     */
    private Long appPackageId;
    /**
     * 相对根目录的存储路径
     */
    private String relativePath;
    /**
     * 文件名称
     */
    private String fileName;
    /**
     * 文件的摘要信息.MD5或者SHA-1.如果摘要信息相同,则认为是相同文件
     */
    @NotNull
    private String digest;

    public Long getAppPackageId() {
        return appPackageId;
    }

    public void setAppPackageId(Long appPackageId) {
        this.appPackageId = appPackageId;
    }

    public String getRelativePath() {
        return relativePath;
    }

    public void setRelativePath(String relativePath) {
        this.relativePath = relativePath;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getDigest() {
        return digest;
    }

    public void setDigest(String digest) {
        this.digest = digest;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        AppPackageItemParam param = (AppPackageItemParam) o;
        return Objects.equals(appPackageId, param.appPackageId) && Objects.equals(relativePath, param.relativePath)
                && Objects.equals(fileName, param.fileName) && Objects.equals(digest, param.digest);
    }

    @Override
    public int hashCode() {
        return Objects.hash(appPackageId, relativePath, fileName, digest);
    }
}
